<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags"  prefix="s"%>
<%@  taglib  uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'listResource.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" type="text/css"
			href="./styles/control_panel.css"/>
	<link rel="stylesheet" type="text/css" href="./styles/sysTable.css"/>
	<script src="./javaScripts/jquery-1.5.1.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="./javaScripts/sysTable.js"></script>
	<script type="text/javascript">
		function deleteData(){
			var flag = confirm("确定要删除资源嘛?");
			if(flag){
				return true;
			}else{
				return false;
			}
		}
	</script>
  </head>
  
  <body>
      <div style="margin-bottom: 4px;margin-left:12px;">
	    
	 	<pg:pager url="bbs/resource/resource_listResource"  maxIndexPages="10"  maxPageItems="5"   scope="request" export="currentPageNumber=pageNumber">
		<div style="border: 1px solid #cccccc; height:auto!important;  height:100px;min-height:100px; ">
			<div class="control_con_right_0021">
				<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td align="left" class="tb_left" valign="middle" colspan="3" style="padding-left: 10px;"> 
							资源列表
						</td>

					</tr>

				</table>
			</div>
              <div class="control_con_right_0022" >
				<div class="control_con_right_00221">
					<table border="0" cellpadding="0" cellspacing="0" width="100%"
						align="center" style="color: #1E5B77;" class="tb_msg">
						<tr>
							<td width="20%" align="center">
								菜单名称
							</td>
							<td width="20%" align="center">
								序列号
							</td>
							<td width="20%" align="center">
								链接：
							</td>
							<td width="20%" align="center">
							是否为父菜单
							</td>
							<td width="20%" align="center">
							操作
							</td>
						</tr>
					</table>
				</div>
				<s:if test="resourceList!=null && resourceList.size>0 ">
					<div>
						
						  <table border="0" cellpadding="0" cellspacing="0" width="100%"
						align="center" id="tb_msg_">
					<s:iterator value="resourceList" status="li">
					 	<pg:item>
						<tr >
							<td width="20%" align="center">
							 <s:property value="menuName" />
							</td>
							<td width="20%" align="center">
								 <s:property value="sequenceNum"/>
							</td>
							<td width="20%" align="center">
							 <s:if test="uri==null || uri=='' || uri=='null'">
							     尚未添加链接
							 </s:if>
							  <s:else>
								<s:property value="uri"/>
								</s:else>
							</td>
							<td width="20%" align="center">&nbsp;
							 
							<s:if test="parentFlag==0">否</s:if>
					<s:if test="parentFlag==1">是</s:if>
							</td>
								<td width="20%" align="center">&nbsp;
							 
						      <s:url action="resource_updateResourceUI.action" var="updateResourceUI">
						<s:param name="resourceId" value="id"></s:param>
					</s:url>
					<a href="${updateResourceUI}">修改</a>&nbsp;&nbsp;
					<s:url action="resource_deleteResourceUI.action" var="deleteResourceUI">
						<s:param name="resourceId" value="id"></s:param>
					</s:url>
					<a href="${deleteResourceUI}" onclick="if(!deleteData()){return false;}">删除</a> 
							</td>
						</tr>
				 	</pg:item>
					</s:iterator> 
					       
					</table>
					    
						
					</div>
				</s:if>
				<s:else>
					<div
						style="text-align: left; padding-left: 20px; padding-top: 4px;">
						 尚未添加资源，列表为空！
					</div>
				</s:else>
			</div>
          </div>
          <!-- 分页控件 -->
           <div style="text-align: right;" id="page_con">
              			 
					    	<pg:prev>
							<a href="${pageUrl}" ><div  class="page_" id="pag_prev" >Prev</div></a> 
						  </pg:prev>
						 <pg:pages>
							 
								<s:if test="#request.currentPageNumber == #request.pageNumber}">
									<font color="red">${pageNumber}</font>
								</s:if>
								<s:else>
									<a href="${pageUrl}"><div  class="page_">${pageNumber}</div></a>
								</s:else>
							 
						</pg:pages>
						<pg:next>
							<a href="${pageUrl}"><div  class="page_" id="pag_next">Next</div></a>
						</pg:next>
 
           </div>
		 
		 
		 </pg:pager>
		 <s:debug></s:debug>
          </div>
  </body>
</html>
